import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/films',
    name: 'films',
    component: Home,
    children: [
      {
        path: '/films/nowPlaying',
        name:"nowPlaying",
        component: () => import('../views/NowPlaying.vue')
      }

      , {
        path: '/films/comingSoon',
        name:"comingSoong",
        component:()=>import('../views/ComingSoon.vue')
      }
    ],
    redirect:"/films/nowPlaying"
  },{
    path:'/films/:id',
    name:"detail",
    component:()=>import('../views/detail.vue')
  },{
    path:'/city',
    name:'city',
    component:()=>import('../views/City.vue')
  }

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router